package com.cl.cloud.binlog.parser;

import com.cl.cloud.binlog.binlogEntity.BinLogEntityHandle;
import com.cl.cloud.binlog.constant.EventEntityType;
import com.cl.cloud.binlog.tableMeta.ColumnMetaData;
import com.github.shyiko.mysql.binlog.event.Event;
import lombok.Data;

import java.util.List;

/**
 * @description: 保存binlog事件数据
 * @author: liuzijian
 * @time: 2021-12-21 14:52
 */
@Data
public class EventEntity {

    /**
     * 事件对象
     */
    private Event event;

    /**
     * 数据库名称
     */
    private String databaseName;

    /**
     * 表名
     */
    private String tableName;

    /**
     * 数据库字段
     */
    private List<ColumnMetaData> columns;

    /**
     * 更新前字段值
     */
    private List<String> changeBefore;

    /**
     * 更新后字段值
     */
    private List<String> changeAfter;

    /**
     * 事件类型
     */
    private EventEntityType eventEntityType;

    /**
     * 更新后数据实体
     */
    private BinLogEntityHandle changeAfterEntity;

    /**
     * 更新前数据实体
     */
    private BinLogEntityHandle changeBeforeEntity;
}
